<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .hidDiv{
            background-color: rgba(255,0,0,0.5);
            left:0px;
            top:0px;
            position: absolute;
            visibility: hidden;
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 100%;
        }

        .contentDiv{
            width: 550px;
            height: 350px;
            background-color: white;
            border: 1px solid #000;
            padding: 50px;
        }
    </style>
    <script src="employee.js"></script>
    <script src="emService.js"></script>


</head>
<body>
    <table border="1" width="80%">
        <thead>
            <tr><th  onclick="sortEmployee('code')">编号</th><th>姓名</th><th onclick="sortEmployee('money')">工资</th><th>性别</th><th>操作</th></tr>
        </thead>

        <tbody id="data"></tbody>
    </table>
    姓名：<input type="text" id="nameTxt">
    <input type="button" value="查找" onclick="findByName()"><br>
    <input type="button" value="添加" onclick="showAddDiv()">

    <div class="hidDiv" id="addDiv">
        <div class="contentDiv">
            编号：<input type="text" id="codeTxt" onblur="checkCode()"><span id="codeErrorSpan"></span><br>
            姓名：<input type="text" id="emNameTxt" onblur="checkName()"><span id="nameErrorSpan"></span><br>
            工资：<input type="text" id="moneyTxt" onblur="checkMoney()"><span id="moneyErrorSpan"></span><br>
            性别：<input type="text" id="sexTxt" onblur="checkSex()"><span id="sexErrorSpan"></span><br>
            <input type="button" value="添加" onclick="add()">
        </div>
    </div>

    <div class="hidDiv" id="updateDiv">
        <div class="contentDiv">
            编号：<span id="codeSpan"></span><br>
            姓名：<span id="nameSpan"></span><br>
            工资：<input type="text" id="updateMoneyTxt"><br>
            性别：<span id="sexSpan"></span><br>
            <input type="button" value="修改" onclick="update()">
        </div>
    </div>
</body>
</html>